<template>
	<div class="page-wrap">
		<div class="page-content p-0">
			<div class="page-column p-0">
				<div class="page-form p-x-0">
					<el-form
						:model="ruleForm"
						:rules="rules"
						label-position="left"
						label-width="154px"
						ref="form"
						label-suffix="："
					>
						<el-row>
							<el-col :span="24">
								<!-- <el-form-item label="是否打印日志信息" prop="CHKSWTCH001">
									<select-para
										style="width:100%"
										class="mediumForm"
										v-model="ruleForm.CHKSWTCH001"
										:label.sync="ruleForm.CHKSWTCH001Name"
										:options="CHKSWTCH001options"
									></select-para>
								</el-form-item> -->
								<el-form-item label="第9种结果的数量" prop="TYPE9NUMBER">
									<select-para
										style="width:100%"
										class="mediumForm"
										v-model="ruleForm.TYPE9NUMBER"
										:label.sync="ruleForm.TYPE9NUMBER"
										:options="TYPE9NUMBERoptions"
										@change="numChange"
									></select-para>
								</el-form-item>
								<el-form-item label prop="name"></el-form-item>
								<el-table ref="multipleTable" :data="ruleForm.TYPE9OUTTab" tooltip-effect="dark" border>
									<el-table-column prop="TYPE9OUT_ORG" label="输出器官" align="center" min-width="120">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYPE9OUT_ORG"
												:prop="'TYPE9OUTTab.'+scope.$index+'.TYPE9OUT_ORG'"
											>
												<select-para
													style="width:100%"
													class="bigForm"
													v-model="scope.row.TYPE9OUT_ORG"
													:label.sync="scope.row.TYPE9OUT_ORGName"
													:options="TYPE9OUT_ORGoptions"
												></select-para>
											</el-form-item>
										</template>
									</el-table-column>
									<el-table-column prop="TYPE9OUT_ST" label="开始的距离数" min-width="120" align="center">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYPE9OUT_ST"
												:prop="'TYPE9OUTTab.'+scope.$index+'.TYPE9OUT_ST'"
											>
												<!-- <el-input
													oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,20})?).*$/g, '$1')"
													class="bigForm"
													v-model="scope.row.TYPE9OUT_ST"
												></el-input> -->
												<el-select class="bigForm" v-model="scope.row.TYPE9OUT_ST" clearable placeholder="请选择">
															<el-option
															v-for="(item,index) in basic_Data.GESPAEND_DISTANCE"
															:key="index"
															:label="item"
															:value="index+1">
															</el-option>
														</el-select>
											</el-form-item>
										</template>
									</el-table-column>
									<el-table-column prop="TYPE9OUT_ED" label="结束的距离数" align="center" min-width="120">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYPE9OUT_ED"
												:prop="'TYPE9OUTTab.'+scope.$index+'.TYPE9OUT_ED'"
											>
												<!-- <el-input
													oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,20})?).*$/g, '$1')"
													class="bigForm"
													v-model="scope.row.TYPE9OUT_ED"
												></el-input> -->
												<el-select class="bigForm" v-model="scope.row.TYPE9OUT_ED" clearable placeholder="请选择">
															<el-option
															v-for="(item,index) in basic_Data.GESPAEND_DISTANCE"
															:key="index"
															:label="item"
															:value="index+1">
															</el-option>
														</el-select>
											</el-form-item>
										</template>
									</el-table-column>
									<el-table-column prop="TYPE9OUT_CCDF" label="是否输出CCDF" min-width="120" align="center">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYPE9OUT_CCDF"
												:prop="'TYPE9OUTTab.'+scope.$index+'.TYPE9OUT_CCDF'"
											>
												<select-para
													style="width:100%"
													class="bigForm"
													v-model="scope.row.TYPE9OUT_CCDF"
													:label.sync="scope.row.TYPE9OUT_CCDF"
													:options="TYPE9OUT_CCDFoptions"
												></select-para>
											</el-form-item>
										</template>
									</el-table-column>
								</el-table>
							</el-col>
						</el-row>
						<div class="separate m-b-20"></div>
						<el-row>
							<el-col :span="24">
								<el-form-item label="第10种结果的数量" prop="TYP10NUMBER">
									<select-para
										style="width:100%"
										class="mediumForm"
										v-model="ruleForm.TYP10NUMBER"
										:label.sync="ruleForm.TYP10NUMBER"
										:options="TYPE9NUMBERoptions"
										@change="TYP10numChange"
									></select-para>
								</el-form-item>
								<el-form-item label prop="name"></el-form-item>
								<el-table ref="multipleTable" :data="ruleForm.TYP10OUTTab" tooltip-effect="dark" border>
									<el-table-column prop="TYP10OUT_ST" label="开始的距离数" min-width="120" align="center">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYP10OUT_ST"
												:prop="'TYP10OUTTab.'+scope.$index+'.TYP10OUT_ST'"
											>
												<!-- <el-input
													oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,20})?).*$/g, '$1')"
													class="bigForm"
													v-model="scope.row.TYP10OUT_ST"
												></el-input> -->
												<el-select class="bigForm" v-model="scope.row.TYP10OUT_ST" clearable placeholder="请选择">
															<el-option
															v-for="(item,index) in basic_Data.GESPAEND_DISTANCE"
															:key="index"
															:label="item"
															:value="index+1">
															</el-option>
														</el-select>
											</el-form-item>
										</template>
									</el-table-column>
									<el-table-column prop="TYP10OUT_ED" label="结束的距离数" align="center" min-width="120">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYP10OUT_ED"
												:prop="'TYP10OUTTab.'+scope.$index+'.TYP10OUT_ED'"
											>
												<!-- <el-input
													oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,20})?).*$/g, '$1')"
													class="bigForm"
													v-model="scope.row.TYP10OUT_ED"
												></el-input> -->
												<el-select class="bigForm" v-model="scope.row.TYP10OUT_ED" clearable placeholder="请选择">
															<el-option
															v-for="(item,index) in basic_Data.GESPAEND_DISTANCE"
															:key="index"
															:label="item"
															:value="index+1">
															</el-option>
														</el-select>
											</el-form-item>
										</template>
									</el-table-column>
									<el-table-column prop="TYP10OUT_CCDF" label="是否输出CCDF" min-width="120" align="center">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYP10OUT_CCDF"
												:prop="'TYP10OUTTab.'+scope.$index+'.TYP10OUT_CCDF'"
											>
												<select-para
													style="width:100%"
													class="bigForm"
													v-model="scope.row.TYP10OUT_CCDF"
													:label.sync="scope.row.TYP10OUT_CCDF"
													:options="TYPE9OUT_CCDFoptions"
												></select-para>
											</el-form-item>
										</template>
									</el-table-column>
								</el-table>
								<el-form-item label="是否打印最大行为距离" prop="TYP11FLAG11">
									<select-para
										style="width:100%"
										class="mediumForm"
										v-model="ruleForm.TYP11FLAG11"
										:label.sync="ruleForm.TYP11FLAG11"
										:options="TYP11FLAG11options"
									></select-para>
								</el-form-item>
							</el-col>
						</el-row>
						<div class="separate m-b-20"></div>
						<el-row>
							<el-col :span="24">
								<el-form-item label="第12种结果的数量" prop="TYP12NUMBER">
									<select-para
										style="width:100%"
										class="mediumForm"
										v-model="ruleForm.TYP12NUMBER"
										:label.sync="ruleForm.TYP12NUMBER"
										:options="TYPE9NUMBERoptions"
										@change="TYP12numChange"
									></select-para>
								</el-form-item>
								<el-form-item label prop="name"></el-form-item>
								<el-table ref="multipleTable" :data="ruleForm.TYPE12OUTTab" tooltip-effect="dark" border>
									<el-table-column prop="TYP12OUT_ST" label="开始的距离数" min-width="120" align="center">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYP12OUT_ST"
												:prop="'TYPE12OUTTab.'+scope.$index+'.TYP12OUT_ST'"
											>
												<!-- <el-input
													oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,20})?).*$/g, '$1')"
													class="bigForm"
													v-model="scope.row.TYP12OUT_ST"
												></el-input> -->
												<el-select class="bigForm" v-model="scope.row.TYP12OUT_ST" clearable placeholder="请选择">
															<el-option
															v-for="(item,index) in basic_Data.GESPAEND_DISTANCE"
															:key="index"
															:label="item"
															:value="index+1">
															</el-option>
														</el-select>
											</el-form-item>
										</template>
									</el-table-column>
									<el-table-column prop="TYP12OUT_ED" label="结束的距离数" align="center" min-width="120">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYP12OUT_ED"
												:prop="'TYPE12OUTTab.'+scope.$index+'.TYP12OUT_ED'"
											>
												<!-- <el-input
													oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,20})?).*$/g, '$1')"
													class="bigForm"
													v-model="scope.row.TYP12OUT_ED"
												></el-input> -->
												<el-select class="bigForm" v-model="scope.row.TYP12OUT_ED" clearable placeholder="请选择">
															<el-option
															v-for="(item,index) in basic_Data.GESPAEND_DISTANCE"
															:key="index"
															:label="item"
															:value="index+1">
															</el-option>
														</el-select>
											</el-form-item>
										</template>
									</el-table-column>
									<el-table-column prop="TYP12OUT_CCDF" label="是否输出CCDF" min-width="120" align="center">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYP12OUT_CCDF"
												:prop="'TYPE12OUTTab.'+scope.$index+'.TYP12OUT_CCDF'"
											>
												<select-para
													style="width:100%"
													class="bigForm"
													v-model="scope.row.TYP12OUT_CCDF"
													:label.sync="scope.row.TYP12OUT_CCDF"
													:options="TYPE9OUT_CCDFoptions"
												></select-para>
											</el-form-item>
										</template>
									</el-table-column>
								</el-table>
							</el-col>
						</el-row>
						<div class="separate m-b-20"></div>
						<el-row>
							<el-col :span="24">
								<el-form-item label="第13种结果的数量" prop="TYP13NUMBER">
									<select-para
										style="width:100%"
										class="mediumForm"
										v-model="ruleForm.TYP13NUMBER"
										:label.sync="ruleForm.TYP13NUMBER"
										:options="TYP13NUMBERoptions"
										@change="TYP13NUMBERnumChange"
									></select-para>
								</el-form-item>
								<el-form-item label prop="name"></el-form-item>
								<el-table ref="multipleTable" :data="ruleForm.TYPE13OUTTab" tooltip-effect="dark" border>
									<el-table-column prop="TYP13OUT_IRAD" label="结果所在距离" min-width="120" align="center">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYP13OUT_IRAD"
												:prop="'TYPE13OUTTab.'+scope.$index+'.TYP13OUT_IRAD'"
											>
												<!-- <el-input
													oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,20})?).*$/g, '$1')"
													class="bigForm"
													v-model="scope.row.TYP13OUT_IRAD"
												></el-input> -->
												<el-select class="bigForm" v-model="scope.row.TYP13OUT_IRAD" clearable placeholder="请选择">
															<el-option
															v-for="(item,index) in basic_Data.GESPAEND_DISTANCE"
															:key="index"
															:label="item"
															:value="index+1">
															</el-option>
														</el-select>
											</el-form-item>
										</template>
									</el-table-column>
									<el-table-column prop="TYP13OUT_ORGN" label="剂量类型" align="center" min-width="120">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYP13OUT_ORGN"
												:prop="'TYPE13OUTTab.'+scope.$index+'.TYP13OUT_ORGN'"
											>
												<select-para
													class="bigForm"
													v-model="scope.row.TYP13OUT_ORGN"
													:label.sync="scope.row.TYP13OUT_ORGN"
													:options="TYP13OUT_ORGNoptions"
												></select-para>
											</el-form-item>
										</template>
									</el-table-column>
									<el-table-column prop="TYP13OUT_CCDF" label="是否输出CCDF" min-width="120" align="center">
										<template slot-scope="scope">
											<el-form-item
												label-width="0px"
												:rules="rules.TYP13OUT_CCDF"
												:prop="'TYPE13OUTTab.'+scope.$index+'.TYP13OUT_CCDF'"
											>
												<select-para
													style="width:100%"
													class="bigForm"
													v-model="scope.row.TYP13OUT_CCDF"
													:label.sync="scope.row.TYP13OUT_CCDF"
													:options="TYPE9OUT_CCDFoptions"
												></select-para>
											</el-form-item>
										</template>
									</el-table-column>
								</el-table>
							</el-col>
						</el-row>
					</el-form>
				</div>
				<div class="bottom-btn">
					<el-button
						type="primary"
						:disabled="this.basic_Data.OCENDAT1001=='TRUE' ||this.early_Data.MIENDAT2001=='TRUE'"
						:loading="loading"
						@click="submitFun"
					>提 交</el-button>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import selectPara from "@/components/selectPara"
import commCheckbox from "@/components/commCheckbox"
import ImageCropper from "@/components/ImageCropper"
import FixBottomButton from "@/components/FixBottomButton"
import ueditor from "@/components/ueditor"
import textLength from "@/components/common/comp/textLength"
import { commPara } from "@/mixins/mixins"
import { mapState } from "vuex"
import { dome, selecttext } from "@/utils/verify.js"
import { BATCH_SUBMIT } from "@/service/hd5.js"

export default {
	name: "aboutUs",
	props: {
		basicDataF: Object,
	},
	mixins: [commPara],
	components: {
		selectPara,
		ImageCropper,
		textLength,
		commCheckbox,
		FixBottomButton,
		ueditor,
	},

	data() {
		var C1GEN = (rule, value, callback) => { 
			if (value == "") {
				callback(new Error("输入值不能为空"))
			} else if (
				parseFloat(value) < 1 ||
				value > this.basic_Data.GESPAEND_DISTANCE.length
			) {
				callback(
					new Error(
						"输入范围为[1，" +
							this.basic_Data.GESPAEND_DISTANCE.length +
							"]"
					)
				)
			} else {
				callback()
			}
		}
		var CTGEN = (rule, value, callback) => { 
			if (value == "") {
				callback(new Error("输入值不能为空"))
			} else if (
				parseFloat(value) < 1 ||
				value > this.basic_Data.GESPAEND_DISTANCE.length
			) {
				callback(
					new Error(
						"输入范围为[1，" +
							this.basic_Data.GESPAEND_DISTANCE.length +
							"]"
					)
				)
			} else {
				callback()
			}
		}
		return {
			activeTab: "8",
			GENUMRAD001: "",
			ruleForm: {
				CHKSWTCH001: "0",
				CHKSWTCH001Name: "",
				TYPE9NUMBER: "1",
				TYP10NUMBER: "",
				TYP12NUMBER: "",
				TYP13NUMBER: "",
				TYPE9OUTTab: [],
				TYP10OUTTab: [],
				TYPE12OUTTab: [],
				TYPE13OUTTab: [],
			},
			rules: {
				TYPE9OUT_ST: [
					{ validator: C1GEN, trigger: ["change", "blur"] },
				],
				TYPE9OUT_ED: [
					{ validator: CTGEN, trigger: ["change", "blur"] },
				],
				TYPE9OUT_ST: [
					{ validator: C1GEN, trigger: ["change", "blur"] },
				],
				TYP10OUT_ST: [
					{ validator: C1GEN, trigger: ["change", "blur"] },
				],
				TYP10OUT_ED: [
					{ validator: CTGEN, trigger: ["change", "blur"] },
				],
				TYP12OUT_ST: [
					{ validator: C1GEN, trigger: ["change", "blur"] },
				],
				TYP12OUT_ED: [
					{ validator: CTGEN, trigger: ["change", "blur"] },
				],
			},

			// CHKSWTCH001options: [
			// 	{
			// 		label: "是",
			// 		value:"0",
			// 	},
			// 	{
			// 		label: "否",
			// 		value: "1",
			// 	},
			// ],
			TYP11FLAG11options: [
				{
					label: "TRUE",
					value: "TRUE",
				},
				{
					label: "FALSE",
					value: "FALSE",
				},
			],
			TYPE9NUMBERoptions: [],
			TYPE9OUT_ORGoptions: [],
			TYPE9OUT_CCDFoptions: [
				{
					label: "",
					value: "",
				},
				{
					label: "CCDF",
					value: "CCDF",
				},
			],
			TYP13OUT_ORGNoptions: [
				{
					label: "EFFECTIVE",
					value: "EFFECTIVE",
				},
				{
					label: "THYROID",
					value: "THYROID",
				},
			],
			loading: false,
		}
	},
	computed: {
		...mapState({
			early_Data: (state) => state.token.early_Data,
			basic_Data: (state) => state.token.basic_Data,
			longterm_Data: (state) => state.token.longterm_Data,
		}),
	},
	created() {
		this.setOptions()
	},
	mounted() {
		this.setData()
	},
	methods: {
		setOptions() {
			this.GENUMRAD001 = this.basic_Data.GESPAEND_DISTANCE.length 
			//获取MIORGDEF_ORG
			if (
				this.early_Data.DCF_FILE001 == "DOSDATA.INP" ||
				this.early_Data.DCF_FILE001 == "DOSDATA.NEW"
			) {
				this.MIORGDEF_ORG = this.$props.basicDataF.MIORGDEF_ORG1
			} else if (
				this.early_Data.DCF_FILE001 == "DOSD60.INP" ||
				this.early_Data.DCF_FILE001 == "DOSD825.INP"
			) {
				this.MIORGDEF_ORG = this.$props.basicDataF.MIORGDEF_ORG2
			} 
			this.TYPE9OUT_ORGoptions = this.MIORGDEF_ORG.map((item) => {
				return {
					label: item.dic_cname,
					value: item.dic_ename,
				}
			})

			this.TYPE9NUMBERoptions = []
			for (let index = 1; index <= 10; index++) {
				let templabel = {
					label: index,
					value: index,
				}
				this.TYPE9NUMBERoptions.push(templabel)
			}

			this.TYP13NUMBERoptions = []
			for (let index = 1; index <= 20; index++) {
				let templabel = {
					label: index,
					value: index,
				}
				this.TYP13NUMBERoptions.push(templabel)
			}
		},
		setData() {
			// this.ruleForm.CHKSWTCH001 = this.longterm_Data.CHKSWTCH001
			// 	? this.longterm_Data.CHKSWTCH001.toString()
			// 	: "0"
			this.ruleForm.TYPE9NUMBER = this.longterm_Data.TYPE9NUMBER
				? this.longterm_Data.TYPE9NUMBER.toString()
				: ""
			this.ruleForm.TYP10NUMBER = this.longterm_Data.TYP10NUMBER
				? this.longterm_Data.TYP10NUMBER.toString()
				: ""
			this.ruleForm.TYP11FLAG11 = this.longterm_Data.TYP11FLAG11
				? this.longterm_Data.TYP11FLAG11.toString()
				: "TRUE"
			this.ruleForm.TYP12NUMBER = this.longterm_Data.TYP12NUMBER
				? this.longterm_Data.TYP12NUMBER.toString()
				: ""
			this.ruleForm.TYP13NUMBER = this.longterm_Data.TYP13NUMBER
				? this.longterm_Data.TYP13NUMBER.toString()
				: ""
		},
		numChange(value) { 
			if (value) {
				this.ruleForm.TYPE9OUTTab = []
				for (let index = 0; index < value; index++) { 
					let tempitem = {
						TYPE9OUT_ORG: this.longterm_Data.TYPE9OUT_ORG[index]
							? this.longterm_Data.TYPE9OUT_ORG[index]
							: "",
						TYPE9OUT_ORGName: "",
						TYPE9OUT_ST: this.longterm_Data.TYPE9OUT_ST[index]
							? this.longterm_Data.TYPE9OUT_ST[index]
							: "",
						TYPE9OUT_ED: this.longterm_Data.TYPE9OUT_ED[index]
							? this.longterm_Data.TYPE9OUT_ED[index]
							: "",
						TYPE9OUT_CCDF: this.longterm_Data.TYPE9OUT_CCDF[index]
							? this.longterm_Data.TYPE9OUT_CCDF[index]
							: "",
					} 
					this.ruleForm.TYPE9OUTTab.push(tempitem)
				}
			}
		},
		TYP10numChange() {
			if (this.ruleForm.TYP10NUMBER) {
				this.ruleForm.TYP10OUTTab = []
				for (
					let index = 0;
					index < parseInt(this.ruleForm.TYP10NUMBER);
					index++
				) { 
					let tempitem = {
						TYP10OUT_ST: this.longterm_Data.TYP10OUT_ST[index]
							? this.longterm_Data.TYP10OUT_ST[index]
							: "",
						TYP10OUT_ED: this.longterm_Data.TYP10OUT_ED[index]
							? this.longterm_Data.TYP10OUT_ED[index]
							: "",
						TYP10OUT_CCDF: this.longterm_Data.TYP10OUT_CCDF[index]
							? this.longterm_Data.TYP10OUT_CCDF[index]
							: "",
					}
					this.ruleForm.TYP10OUTTab.push(tempitem)
				} 
			}
		},
		TYP12numChange(value) { 
			if (value) {
				this.ruleForm.TYPE12OUTTab = []
				for (let index = 0; index < value; index++) { 
					let tempitem = {
						TYP12OUT_ST: this.longterm_Data.TYP12OUT_ST[index]
							? this.longterm_Data.TYP12OUT_ST[index]
							: "",
						TYP12OUT_ED: this.longterm_Data.TYP12OUT_ED[index]
							? this.longterm_Data.TYP12OUT_ED[index]
							: "",
						TYP12OUT_CCDF: this.longterm_Data.TYP12OUT_CCDF[index]
							? this.longterm_Data.TYP12OUT_CCDF[index]
							: "",
					} 
					this.ruleForm.TYPE12OUTTab.push(tempitem)
				} 
			}
		},
		TYP13NUMBERnumChange(value) { 
			if (value) {
				this.ruleForm.TYPE13OUTTab = []
				for (let index = 0; index < value; index++) { 
					let tempitem = {
						TYP13OUT_IRAD: this.longterm_Data.TYP13OUT_IRAD[index]
							? this.longterm_Data.TYP13OUT_IRAD[index]
							: "",
						TYP13OUT_ORGN: this.longterm_Data.TYP13OUT_ORGN[index]
							? this.longterm_Data.TYP13OUT_ORGN[index]
							: "",
						TYP13OUT_CCDF: this.longterm_Data.TYP13OUT_CCDF[index]
							? this.longterm_Data.TYP13OUT_CCDF[index]
							: "",
					} 
					this.ruleForm.TYPE13OUTTab.push(tempitem)
				}
			}
		},
		submitFun() {
			//保存
			this.$refs.form.validate((valid) => {
				if (valid) { 
					let tempdata = JSON.parse(
						JSON.stringify(this.longterm_Data)
					) 
					// tempdata.CHKSWTCH001 = this.ruleForm.CHKSWTCH001
					tempdata.CHKSWTCH001=0
					tempdata.TYPE9NUMBER = parseInt(this.ruleForm.TYPE9NUMBER)
						? parseInt(this.ruleForm.TYPE9NUMBER)
						: 0
					if (tempdata.TYPE9NUMBER > 0) {
						tempdata.TYPE9OUT_ORG = this.ruleForm.TYPE9OUTTab.map(
							(item) => {
								return item.TYPE9OUT_ORG
							}
						)
						tempdata.TYPE9OUT_ST = this.ruleForm.TYPE9OUTTab.map(
							(item) => {
								return parseInt(item.TYPE9OUT_ST)
							}
						)
						tempdata.TYPE9OUT_ED = this.ruleForm.TYPE9OUTTab.map(
							(item) => {
								return parseInt(item.TYPE9OUT_ED)
							}
						)
						tempdata.TYPE9OUT_CCDF = this.ruleForm.TYPE9OUTTab.map(
							(item) => {
								return item.TYPE9OUT_CCDF
									? item.TYPE9OUT_CCDF
									: ""
							}
						)
					} else {
						tempdata.TYPE9OUT_ORG = []
						tempdata.TYPE9OUT_ST = []
						tempdata.TYPE9OUT_ED = []
						tempdata.TYPE9OUT_CCDF = []
					}

					tempdata.TYP10NUMBER = parseInt(this.ruleForm.TYP10NUMBER)
						? parseInt(this.ruleForm.TYP10NUMBER)
						: 0

					if (tempdata.TYP10NUMBER > 0) {
						tempdata.TYP10OUT_ST = this.ruleForm.TYP10OUTTab.map(
							(item) => {
								return parseInt(item.TYP10OUT_ST)
							}
						)
						tempdata.TYP10OUT_ED = this.ruleForm.TYP10OUTTab.map(
							(item) => {
								return parseInt(item.TYP10OUT_ED)
							}
						)
						tempdata.TYP10OUT_CCDF = this.ruleForm.TYP10OUTTab.map(
							(item) => {
								return item.TYP10OUT_CCDF
									? item.TYP10OUT_CCDF
									: ""
							}
						)
					} else {
						tempdata.TYP10OUT_ST = []
						tempdata.TYP10OUT_ED = []
						tempdata.TYP10OUT_CCDF = []
					}

					tempdata.TYP11FLAG11 = this.ruleForm.TYP11FLAG11

					tempdata.TYP12NUMBER = parseInt(this.ruleForm.TYP12NUMBER)
						? parseInt(this.ruleForm.TYP12NUMBER)
						: 0

					if (tempdata.TYP12NUMBER > 0) {
						tempdata.TYP12OUT_ST = this.ruleForm.TYPE12OUTTab.map(
							(item) => {
								return parseInt(item.TYP12OUT_ST)
							}
						)
						tempdata.TYP12OUT_ED = this.ruleForm.TYPE12OUTTab.map(
							(item) => {
								return parseInt(item.TYP12OUT_ED)
							}
						)
						tempdata.TYP12OUT_CCDF = this.ruleForm.TYPE12OUTTab.map(
							(item) => {
								return item.TYP12OUT_CCDF
									? item.TYP12OUT_CCDF
									: ""
							}
						)
					} else {
						tempdata.TYP12OUT_ST = []
						tempdata.TYP12OUT_ED = []
						tempdata.TYP12OUT_CCDF = []
					}

					tempdata.TYP13NUMBER = parseInt(this.ruleForm.TYP13NUMBER)
						? parseInt(this.ruleForm.TYP13NUMBER)
						: 0

					if (tempdata.TYP13NUMBER > 0) {
						tempdata.TYP13OUT_IRAD = this.ruleForm.TYPE13OUTTab.map(
							(item) => {
								return parseInt(item.TYP13OUT_IRAD)
							}
						)
						tempdata.TYP13OUT_ORGN = this.ruleForm.TYPE13OUTTab.map(
							(item) => {
								return item.TYP13OUT_ORGN
							}
						)
						tempdata.TYP13OUT_CCDF = this.ruleForm.TYPE13OUTTab.map(
							(item) => {
								return item.TYP13OUT_CCDF
									? item.TYP13OUT_CCDF
									: ""
							}
						)
					} else {
						tempdata.TYP13OUT_IRAD = []
						tempdata.TYP13OUT_ORGN = []
						tempdata.TYP13OUT_CCDF = []
					}
					tempdata.SETPAGEINDEX = this.activeTab
					this.$store.dispatch("upData_longterm_Data", tempdata) 
					let params = {
						batchid: this.$route.query.id,
						batchinfo: "CHANGQI",
						submitjson: JSON.stringify(tempdata),
					} 
					this.$appApi
						.BATCH_SUBMIT(params)
						.then((res) => { 
							var str = res.data.substring(0, 1)
							if (str == "E") {
								let message = res.data.substring(6)
								this.$notify.error({
									title: "提交失败！",
									message: message,
									type: "success",
								})
							} else if (str == "S") {
								this.$notify({
									message: "提交成功！",
									type: "success",
								})
								this.$router.push({
									path: "/home",
								})
							}
						})
						.catch((err) => {
							console.log(err)
						})
				}
			})
		},
		daochu() {
			//导出
		},
	},
}
</script>
<style lang="scss" scoped>
.page-flex-row /deep/ .el-collapse-item__header {
	background: #f3f9fe;
}
</style>